package ar.edu.uade.centroDistribucion.herramientas;

import java.io.DataInputStream;
import java.io.FileInputStream;

public class FileReader {

	private String file;

	public FileReader(String file){
		this.file = file;
	}

	@SuppressWarnings("deprecation")
	public String obtenerContenido(){
		StringBuffer contenido = new StringBuffer();
		try
		{
			FileInputStream fileInputStream = new FileInputStream(file);
			DataInputStream input = new DataInputStream(fileInputStream);
			while (input.available() !=0)
			{
				contenido.append(input.readLine());
			}
			input.close();
		}catch(Exception ex){
			System.out.println("Error al leer el contenido del archivo: " + file);
		}
		return contenido.toString();
	}
	
}
